#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QFrame>
#include <QHBoxLayout>

#include "mythread.h"

class ImageWidget : public QWidget
{
    friend class AddControl;

    Q_OBJECT
public:
    ImageWidget(QWidget *parent = 0);

public slots:
    void connbtnClicked();
    void pausebtnClicked();
    void cambtnClicked();
    void stopbtnClicked();

    void setErrorState(QString);
    void setImg(QImage);

protected:
    void paintEvent(QPaintEvent *);

private:
    QImage          image;
    QFrame*         frame;
    QLabel*         addrlbl;
    QLabel*         statelbl;
    QPushButton*    connbtn;
    QPushButton*    pausebtn;
    QPushButton*    cambtn;
    QPushButton*    stopbtn;
    QHBoxLayout*    conlayout;

    QString         addr;
    QString         ip;
    int             port;
    int             pauseflag;
    int             stopflag;
    int             camnum;

    MyThread*       capthread;
};

class AddButton : public QWidget{};

#endif
